# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-sphinx-autodoc-typehints
_pyname=sphinx-autodoc-typehints
pkgver=2.0.1
pkgrel=0
pkgdesc="Type hints support for the Sphinx autodoc extension"
url="https://github.com/tox-dev/sphinx-autodoc-typehints"
arch="noarch"
license="MIT"
options="net"
depends="python3 py3-sphinx py3-typing-extensions"
makedepends="py3-gpep517 py3-installer py3-hatchling py3-hatch-vcs"
checkdepends="py3-pytest py3-sphobjinv py3-nptyping"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/tox-dev/sphinx-autodoc-typehints/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/sphinx_autodoc_typehints*.whl
	test-env/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/sphinx_autodoc_typehints*.whl
}

sha512sums="
0bda871f30f523b3e87a94a164668632c7045a5b9b7ac5b3e6d8ce39bc6e462132aaba713e6514e38fdd0507805e2475f694933c3395e2526b335ee36ecdd8f7  sphinx-autodoc-typehints-2.0.1.tar.gz
"
